<template>
	<view>
		<u-empty :show="showEmpty" text="暂无数据" mode="list">
		</u-empty>
		<view class="uni-flex-center" v-for="(item, index) in orderlist">
			<view class="main-service uni-cell-90" style="padding-bottom: 10rpx; width: 96%; margin-left: 2%;">
				<view class="user-list">
					<view class="title u-rela">
						<view class="u-abso pos_left">
							<text>{{item.title}}</text>
						</view>
						<view class="u-abso pos_right" v-if="item.status==0">
							<text style="color:#007AFF;">{{item.status_label}}</text>
						</view>
						<view class="u-abso pos_right" v-if="item.status==1">
							<text style="color:#18B566;">{{item.status_label}}</text>
						</view>
						<view class="u-abso pos_right" v-if="item.status==2">
							<text style="color:#ff0000;">{{item.status_label}}</text>
						</view>
						<view class="u-abso pos_right" v-if="item.status==-1">
							<text style="color:#ff5500;">{{item.status_label}}</text>
						</view>
						<view class="u-abso pos_right" v-if="item.status==3">
							<text style="color:#000000;">{{item.status_label}}</text>
						</view>
					</view>
					<!-- <u-line></u-line> -->
					<view class="u-padding-20">
						<view class="d_view u-margin-bottom-20">
							<text class="l_title">联系人：{{item.name}}</text>
							<!-- <text class="d_content"></text> -->
							<u-icon style="" class="" color="#008b00" name="phone-fill" size="40rpx" @click="makephone(item.tel)"></u-icon>
						</view>
						<view class="d_view u-margin-bottom-20">
							<text class="l_title">服务天数</text>
							<text class="d_content">{{item.during}}</text>
						</view>
						<view class="d_view">
							<text class="l_title">服务日期</text>
							<text class="d_content">{{item.time}}</text>
						</view>
					</view>
					<view class="u-padding-15 u-border-top u-text-right">
						<u-button class="u-margin-right-20" type="primary" shape="circle" size="mini" @click="classDetail(item.id)">查看详情</u-button>
					</view>
					<view style="clear: both;"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getMyAdjacentSchool
	} from "@/service/shareService.js";
	export default {
		data () {
			return {
				orderlist: [],
				showEmpty: false,
				
			}
		},
		onLoad() {
			getMyAdjacentSchool().then(this.getMyAdjacentSchool);
		},
		methods:{
			getMyAdjacentSchool(e) {
				// console.log(e);
				if (e.code == 200) {
					this.showEmpty = false;
					this.orderlist = e.result;
				} else if(e.code == 400) {
					this.showEmpty = true;
					this.orderlist = [];
				}
			},
			classDetail:function(id){
				uni.navigateTo({
					url:'/pages/neighborsEnjoy/fourHalfDetail?id='+id
				})
			},
		}
	}
</script>

<style lang="scss">
	.u-empty.data-v-3d842a77 {
		margin-top:120rpx !important;
	}
	.select_title{
	
		background-color: #0c838b;
	}
	.select_title input{
		width:80%;
		height:50rpx;
		padding:0 10rpx;
		font-size: 26rpx;
		border-radius: 10rpx;
		background-color: #fff;
	}
	.top_title{
		color: $u-type-primary;
		text-align: center;
		padding: 20rpx 0 0 0;
	}
	.u-empty.data-v-3d842a77 {
		margin-top:120rpx !important;
	}
	.l_title {
		color: #999;
		float: left;
	}
	
	.d_content {
		color: #666;
	}
	
	.d_view {
		font-size: 28rpx;
		color: #999;
		/* margin-top: 30rpx; */
		text-align: right;
	}
	.main-service {
		margin-top: 20upx;
		border-radius: 10upx;
		background: #ffffff;
		box-shadow: 5rpx 5rpx 20rpx #ddd;
	}
	
	.main-service .title {
		height:70rpx;
		line-height: 70rpx;
		font-size: 30rpx;
	}
</style>

